const DB = require('../tools/mysql')

module.exports = async ctx => {
  ctx.body = await DB('card')
    .join('style', 'card.style', '=', 'style.id')
    .select('card.id', 'card.title', 'style.code as style', 'card.recommend', 'card.swiper', 'card.display_url', 'card.swiper_url')
    .where('card.show', 1)
    .orWhere('card.swiper', 1)
    .orWhere('card.recommend', 1)
}